export default function () {
    const totalRecords = 100;
    const generateRandomStatus = () => {
        const statuses = [
            { value: 1, label: "可约", key: "available", bg: "#67c23a" },
            { value: 2, label: "已约", key: "booked", bg: "rgb(247 184 206)" },
            // { value: 3, label: "休息", key: "rest", bg: "#b1b1b1" }
        ];
        return statuses[Math.floor(Math.random() * statuses.length)];
    };

    const startMockDate = new Date("2025-06-13").getTime();
    const endMockDate = new Date("2025-07-31").getTime();

    const list = Array.from({ length: totalRecords }, (_, index) => {
        const randomTime = Math.floor(Math.random() * (endMockDate - startMockDate + 1)) + startMockDate;
        const startTime = new Date(randomTime);
        const endTime = new Date(startTime.getTime() + 2 * 60 * 60 * 1000); // 2 hours later
        const status = generateRandomStatus();

        return {
            startTime: startTime.toISOString(),
            endTime: endTime.toISOString(),
            statusText: status.label,
            status: status.value,
        };
    });

    return new Promise((resolve) => {
        setTimeout(() => {
            resolve({
                "code": 0,
                "message": "请求成功",
                "data": list,
                "timestamp": Date.now(),
                "requestId": "82E94E85-9E53-48CC-99CC-9832FB607DA5"
            });
        }, 200);
    });
}